package com.deer.wms.base.system.webservice.client;


import com.deer.wms.base.system.model.bill.BillInSapDetail;
import com.deer.wms.base.system.service.bill.BillInSapDetailService;
import com.deer.wms.base.system.web.billsend.MM101Send;
//import com.deer.wms.base.system.web.billsend.MM101_ZDATA_MKPF;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;

import java.util.List;

@Endpoint
public class ClientSAPTOW1071HBWMSREQUESTImpl implements ClientSAPTOW1071HBWMSREQUEST  {
    @Autowired
    private BillInSapDetailService billInSapDetailService;
    @Override
    public ClientTOWMSRESP sapTOW1071HBWMSREQUEST(ClientTOWMSREQ clientTOWMSREQ) {
        StringBuilder s=new StringBuilder();
        ClientTOWMSRESP hbSAPTOWMSRESP = new ClientTOWMSRESP();
//        try {
//
//            hbSAPTOWMSRESP.setBSKEY("111");
//            hbSAPTOWMSRESP.setSAPKEY("222");
//            List<MM101SendSAPDto> billinsend = billInSapDetailService.billInOkSendToSAP();
//            System.out.println(billinsend);
//            for (BillInSapDetail b:billinsend
//            ) {
            //MM101Send billSend=new MM101Send();

//                MM101Send bs=new MM101Send();
//                MM101_ZDATA_MKPF head = new MM101_ZDATA_MKPF();
//                head.setWMSHN(b.getVBELN2());
//                head.setBLDAT(b.getCreateTime2());
//                head.setBUDAT(b.getCreateTime1());
//                if(b.getLFART().equals("EL")){
//                    head.setBWART("101");
//                }else {
//                    head.setBWART("161");
//                }
//
//
//                MM101Detail item = new MM101Detail();
////                item.setWMSHN(b.getVBELN2());
////                item.setWMSIN(b.getLIFNR());
////                item.setMATNR(b.getMATNR());
////                item.setWERKS(b.getWERKS());
////                item.setLGORT(b.getLGORT());
////                item.setERFMG(b.getRemain()+"");
////                item.setERFME(b.getMEINS());
////                item.setEBELN(b.getVBELN1());
////                item.setEBELP(b.getLGMNG()+"");
//
//                bs.setMKPF(head);
//                bs.setITEM(item);
//                Gson gson = new Gson();
//
//                s.append(gson.toJson(bs));

//            }
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//
//        System.out.println(s.toString());
//        hbSAPTOWMSRESP.setZDATA(s.toString());
//
        return null;
    }
}
